package org.lanqiao.tjut.Test;

import java.util.Scanner;

import org.junit.Test;

public class Sys {
	int user;
	Scanner input = new Scanner(System.in);
	Teacher t = new Teacher();
	Student s = new Student();

	public void sysInterface() {
		// 显示界面
		System.out.println("-----------------------");
		System.out.println("|     荒木庄教务管理系统       |");
		System.out.println("-----------------------");
		System.out.println("*******用户登录*******");
		System.out.println("     1.学生登录             ");
		System.out.println("     2.老师登录             ");
		System.out.println("     3.退出                     ");
		System.out.println("*********************");
	}
public void close(){
	System.out.println("**************************");
	System.out.println("**************************");
	System.out.println("**************************");
	System.out.println("**************************");
	System.out.println("**************************");
	System.out.println("**************************");
	System.out.println("**************************");
	System.out.println("**************************");
}
	@Test
	public void chose() {
		// TODO Auto-generated method stub
		sysInterface();
		System.out.print("请选择您的操作(1.2.3):");
		int a = input.nextInt();
		switch (a) {
		case 1:
			s.doLog();
			doStudent();
			break;
		case 2:
			t.doLog();
			doTeacher();
			break;
		case 3:
			close();
			break;
		default:
			System.out.println("请重新输入");
			chose();
		}

	}

	@Test
	public void doTeacher() {
		
		t.teInterface();
		System.out.println("请输入您要进行的操作(1.2.3.4.0):");
		int i = input.nextInt();
		switch (i) {
		case 1:
			t.doAdd();
			break;
		case 2:
			t.doQuery();
			break;
		case 3:
			t.doChange();
			break;
		case 4:
			t.doDelete();
			;
			break;
		case 0:
			//返回主界面
			chose();
		default:
			System.out.println("请重新输入");
			doTeacher();
			break;
		}
		doTeacher();
	}
	@Test
	public void doStudent() {
		// TODO Auto-generated method stub
		s.stInterface();
        System.out.println("请输入您要进行的操作(1.2.3.4.5.6.7.8.9.10.0):");
        int i=input.nextInt();
        switch (i) {
		case 1:
			s.doSelf();
			break;
		case 2:
			s.doPsw();
			break;
		case 3:
			s.doClassmates();
			break;
		case 4:
			s.doAddFriends();
			break;
		case 5:
			s.doShowFriends();
			break;
		case 6:
			s.doSaveFriends();
			break;
		case 7:
			s.doMessage();
			break;
		case 8:
			s.doMessage2();
			break;
		case 9:
			s.doDelete();
			break;
		case 10:
			s.doNick();
			break;
		case 0:
			chose();
		default:
			System.out.println("请重新输入");
			doStudent();
			break;
		}
        doStudent();
	}
}
